﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApp1
{
    class users
    {
        private string name;
        private int age;
        private char sex;

        public string Name 
        {
            get { return this.name; }
            set { this.name = value; }
        }
        public int Age 
        {

            get { return this.age; }
            set 
            {
                if (value > 0)
                {
                    this.age = value ;
                }
                else 
                {
                    Console.WriteLine("输入错误！");
                }
            }
        }
        public char Sex 
        {
            get { return this.sex; }
            set
            {
                if (value == '男' | value == '女')
                { 
                   this.sex = value  ;
                }
                else 
                {
                    Console.WriteLine("输入错误！");
                }
            }
        }
        public void Users() 
        {
            Console.WriteLine("用户名{0} 年龄{1} 性别{2}",this.name,this.age,this.sex);
        }
    }
    class books
    {
        private string bname;
        private string bID;
        private string brirhAdd;
        private double money;

        public string Bname 
        {
            get { return this.bname; }
            set { this.bname = value; }
        }
        public string BID 
        {
            get { return this.bID; }
            set { this.bID = value; }
        }
        public string BrirhAdd 
        {
            get { return this.brirhAdd; }
            set { this.brirhAdd = value; }
        }
        public double Monry
        {
            get { return this.money; }
            set 
            {
                if (value > 0)
                {
                    this.money = value;
                }
                else
                {
                    Console.WriteLine("输入错误！");
                }
            }
        }
        public void book() 
        {
            Console.WriteLine("图书的名字{0} 编号{1} 出版社{2} 价格{3}", this.bname, this.bID, this.brirhAdd,this.money);
        }
    }
    class pubs
    {
        private string pname;
        private string pAdd;

        public string Pname
        {
            get { return this.pname; }
            set { this.pname = value; }
        }
        public string PAdd
        {
            get { return this.pAdd; }
            set { this.pAdd = value; }
        }
        public void Pub()
        {
            Console.WriteLine("出版社名字{0} 地址{1}", this.pname, this.PAdd);
        }
    }
}
